home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / PCI.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  5.3 KB  |  168 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PCI.p
  3.  
  4.      Contains:    PCI Bus Interfaces.
  5.  
  6.      Version:    Technology:    PowerSurge 1.0.2
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT PCI;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __PCI__}
  27. {$SETC __PCI__ := 1}
  28.  
  29. {$I+}
  30. {$SETC PCIIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __NAMEREGISTRY__}
  37. {$I NameRegistry.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45. {  Types and structures for accessing the PCI Assigned-Address property. }
  46.  
  47.  
  48. CONST
  49.     kPCIRelocatableSpace        = $80;
  50.     kPCIPrefetchableSpace        = $40;
  51.     kPCIAliasedSpace            = $20;
  52.     kPCIAddressTypeCodeMask        = $03;
  53.     kPCIConfigSpace                = 0;
  54.     kPCIIOSpace                    = 1;
  55.     kPCI32BitMemorySpace        = 2;
  56.     kPCI64BitMemorySpace        = 3;
  57.  
  58.  
  59. TYPE
  60.     PCIAddressSpaceFlags                = UInt8;
  61.  
  62. CONST
  63.     kPCIDeviceNumberMask        = $1F;
  64.     kPCIFunctionNumberMask        = $07;
  65.  
  66.  
  67. TYPE
  68.     PCIDeviceFunction                    = UInt8;
  69.     PCIBusNumber                        = UInt8;
  70.     PCIRegisterNumber                    = UInt8;
  71.     PCIAssignedAddressPtr = ^PCIAssignedAddress;
  72.     PCIAssignedAddress = PACKED RECORD
  73.         addressSpaceFlags:        PCIAddressSpaceFlags;
  74.         busNumber:                PCIBusNumber;
  75.         deviceFunctionNumber:    PCIDeviceFunction;
  76.         registerNumber:            PCIRegisterNumber;
  77.         address:                UnsignedWide;
  78.         size:                    UnsignedWide;
  79.     END;
  80.  
  81.  
  82. FUNCTION EndianSwap16Bit(data16: UInt16): UInt16;
  83.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  84.     INLINE $301F, $E158, $3E80;
  85.     {$ENDC}
  86. FUNCTION EndianSwap32Bit(data32: UInt32): UInt32;
  87.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  88.     INLINE $201F, $E158, $4840, $E158, $2E80;
  89.     {$ENDC}
  90. FUNCTION ExpMgrConfigReadByte(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt8): OSErr;
  91.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  92.     INLINE $303C, $0620, $AAF3;
  93.     {$ENDC}
  94. FUNCTION ExpMgrConfigReadWord(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt16): OSErr;
  95.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  96.     INLINE $303C, $0621, $AAF3;
  97.     {$ENDC}
  98. FUNCTION ExpMgrConfigReadLong(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt32): OSErr;
  99.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  100.     INLINE $303C, $0622, $AAF3;
  101.     {$ENDC}
  102. FUNCTION ExpMgrConfigWriteByte(node: RegEntryIDPtr; configAddr: LogicalAddress; value: ByteParameter): OSErr;
  103.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  104.     INLINE $303C, $0523, $AAF3;
  105.     {$ENDC}
  106. FUNCTION ExpMgrConfigWriteWord(node: RegEntryIDPtr; configAddr: LogicalAddress; value: UInt16): OSErr;
  107.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  108.     INLINE $303C, $0524, $AAF3;
  109.     {$ENDC}
  110. FUNCTION ExpMgrConfigWriteLong(node: RegEntryIDPtr; configAddr: LogicalAddress; value: UInt32): OSErr;
  111.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  112.     INLINE $303C, $0625, $AAF3;
  113.     {$ENDC}
  114. FUNCTION ExpMgrIOReadByte(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt8): OSErr;
  115.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  116.     INLINE $303C, $0626, $AAF3;
  117.     {$ENDC}
  118. FUNCTION ExpMgrIOReadWord(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt16): OSErr;
  119.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  120.     INLINE $303C, $0627, $AAF3;
  121.     {$ENDC}
  122. FUNCTION ExpMgrIOReadLong(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt32): OSErr;
  123.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  124.     INLINE $303C, $0628, $AAF3;
  125.     {$ENDC}
  126. FUNCTION ExpMgrIOWriteByte(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: ByteParameter): OSErr;
  127.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  128.     INLINE $303C, $0529, $AAF3;
  129.     {$ENDC}
  130. FUNCTION ExpMgrIOWriteWord(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: UInt16): OSErr;
  131.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  132.     INLINE $303C, $052A, $AAF3;
  133.     {$ENDC}
  134. FUNCTION ExpMgrIOWriteLong(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: UInt32): OSErr;
  135.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  136.     INLINE $303C, $062B, $AAF3;
  137.     {$ENDC}
  138. FUNCTION ExpMgrInterruptAcknowledgeReadByte(entry: RegEntryIDPtr; VAR valuePtr: UInt8): OSErr;
  139.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  140.     INLINE $303C, $0411, $AAF3;
  141.     {$ENDC}
  142. FUNCTION ExpMgrInterruptAcknowledgeReadWord(entry: RegEntryIDPtr; VAR valuePtr: UInt16): OSErr;
  143.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  144.     INLINE $303C, $0412, $AAF3;
  145.     {$ENDC}
  146. FUNCTION ExpMgrInterruptAcknowledgeReadLong(entry: RegEntryIDPtr; VAR valuePtr: UInt32): OSErr;
  147.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  148.     INLINE $303C, $0413, $AAF3;
  149.     {$ENDC}
  150. FUNCTION ExpMgrSpecialCycleWriteLong(entry: RegEntryIDPtr; value: UInt32): OSErr;
  151.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  152.     INLINE $303C, $0419, $AAF3;
  153.     {$ENDC}
  154. FUNCTION ExpMgrSpecialCycleBroadcastLong(value: UInt32): OSErr;
  155.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  156.     INLINE $303C, $021A, $AAF3;
  157.     {$ENDC}
  158. {$ALIGN RESET}
  159. {$POP}
  160.  
  161. {$SETC UsingIncludes := PCIIncludes}
  162.  
  163. {$ENDC} {__PCI__}
  164.  
  165. {$IFC NOT UsingIncludes}
  166.  END.
  167. {$ENDC}
  168.